<?php 
$link = mysql_connect('localhost', 'root', '');
if(!$link)
{
	die('Not connected : ' . mysql_error());
}
$db = mysql_select_db('games');
if(!$db)
{
	die('No db : ' . mysql_error());
}

$firstname = isset($_REQUEST['firstname']) ? $_REQUEST['firstname'] : '';
$lastname = isset($_REQUEST['lastname']) ? $_REQUEST['lastname'] : '';
$email = isset($_REQUEST['email']) ? $_REQUEST['email'] : '';
$identifier = isset($_REQUEST['identifier']) ? $_REQUEST['identifier'] : '';
$username = isset($_REQUEST['username']) ? $_REQUEST['username'] : '';

if($firstname != '' && $lastname != '' && $email != '' && $username != '')
{

$query = sprintf("INSERT INTO users (Firstname, LastName, Email, Identifier, UserName) VALUES ('%s', '%s', '%s', '%s', '%s')", $firstname, $lastname, $email, $identifier, $username);

$result = mysql_query($query);

ob_start();
header( 'Location: profile.php');
}
else
{
	ob_start();
	header( 'Location: create-user.php');
}
?>